﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ITask
{
    /// <summary>
    /// 任务的接口
    /// </summary>
    public interface ITask
    {
        #region Properties
        /// <summary>
        /// 任务ID
        /// </summary>
        string Id { get; set; }

        /// <summary>
        /// 任务配置
        /// </summary>
        TaskConfig Config { get; set; }

        /// <summary>
        /// 任务当前状态
        /// </summary>
        TaskStatus Status { get; }

        /// <summary>
        /// 任务最后一次运行时间
        /// </summary>
        DateTime LastRunTime { get; }
        #endregion

        #region Methods
        /// <summary>
        /// 执行任务
        /// </summary>
        /// <param name="args">参数</param>
        void Run(object[] args);
        #endregion
    }
}
